using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SerialPortCommunicationProject
{
    public class ModBusSetting
    {
        private int addressCode=0x01;
        private int functionCode=0x03;
        private int startAddress=0x0000;
        private int varietyCount=0x0002;
        private bool isAutoGenerate=true;
        private int interval=1000;//默认时间间隔为1000ms

        public ModBusSetting(int addressCode,int functionCode,int startAddress,int varietyCount,bool IsautoGenerate,int interval)
        {
            this.addressCode = addressCode;
            this.functionCode = functionCode;
            this.startAddress = startAddress;
            this.varietyCount = varietyCount;
            this.isAutoGenerate = IsautoGenerate;
            this.interval = interval;
        }

        public int AddressCode { get => addressCode; set => addressCode = value; }
        public int FunctionCode { get => functionCode; set => functionCode = value; }
        public int StartAddress { get => startAddress; set => startAddress = value; }
        public int VarietyCount { get => varietyCount; set => varietyCount = value; }
        public bool IsAutoGenerate1 { get => isAutoGenerate; set => isAutoGenerate = value; }
        public int Interval { get => interval; set => interval = value; }

    }
}
